<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
class PHPExcel_Shared_File
{
    protected static $useUploadTempDirectory = false;
    public static function setUseUploadTempDirectory($useUploadTempDir = false)
    {
        self::$useUploadTempDirectory = (bool) $useUploadTempDir;
    }
    public static function getUseUploadTempDirectory()
    {
        return self::$useUploadTempDirectory;
    }
    public static function file_exists($pFilename)
    {
        if(strtolower(substr($pFilename, 0, 3)) == "zip") {
            $zipFile = substr($pFilename, 6, strpos($pFilename, "#") - 6);
            $archiveFile = substr($pFilename, strpos($pFilename, "#") + 1);
            $zip = new ZipArchive();
            if($zip->open($zipFile) === true) {
                $returnValue = $zip->getFromName($archiveFile) !== false;
                $zip->close();
                return $returnValue;
            }
            return false;
        }
        return file_exists($pFilename);
    }
    public static function realpath($pFilename)
    {
        $returnValue = "";
        if(file_exists($pFilename)) {
            $returnValue = realpath($pFilename);
        }
        if($returnValue == "" || $returnValue === NULL) {
            $pathArray = explode("/", $pFilename);
            while (in_array("..", $pathArray) && $pathArray[0] != "..") {
                $i = 0;
                while ($i < count($pathArray)) {
                    if($pathArray[$i] == ".." && 0 < $i) {
                        unset($pathArray[$i]);
                        unset($pathArray[$i - 1]);
                    } else {
                        $i++;
                    }
                }
            }
            $returnValue = implode("/", $pathArray);
        }
        return $returnValue;
    }
    public static function sys_get_temp_dir()
    {
        if(self::$useUploadTempDirectory && ini_get("upload_tmp_dir") !== false && ($temp = ini_get("upload_tmp_dir")) && file_exists($temp)) {
            return realpath($temp);
        }
        if(!function_exists("sys_get_temp_dir")) {
            if(($temp = getenv("TMP")) && !empty($temp) && file_exists($temp)) {
                return realpath($temp);
            }
            if(($temp = getenv("TEMP")) && !empty($temp) && file_exists($temp)) {
                return realpath($temp);
            }
            if(($temp = getenv("TMPDIR")) && !empty($temp) && file_exists($temp)) {
                return realpath($temp);
            }
            $temp = tempnam(__FILE__, "");
            if(file_exists($temp)) {
                unlink($temp);
                return realpath(dirname($temp));
            }
            return NULL;
        }
        return realpath(sys_get_temp_dir());
    }
}

?>